home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************/
- /* DrawUserIcon */
- /* */
- /* This procedure draws a thick-line rounded rectangle in the userItem which */
- /* has been defined in the same area of the window as the default (item #1) */
- /* button. The userItem must be defined large enough to contain the thick-line */
- /* rounded rectangle. */
- /* */
- /* This procedure gets invoked repeatedly by the Dialog Manager while the dialog */
- /* is active. */
- /* */
- /* Note, parameter "itemNo" is the item number of the userItem, not of the default */
- /* Button. "itemNo" isn't actually used in this procedure. */
- /************************************************************************************/
-
- #include "MyHeaders.h"
-
- pascal void DrawUserIcon(DialogPtr theDialog, short itemNo)
- {
- GrafPtr oldPort;
- PenState oldPen;
- short iType;
- Handle h;
- CIconHandle cH;
- Rect box;
-
- GetPort(&oldPort); /* preserve current grafport */
- SetPort(theDialog); /* point to dialog grafport */
-
- GetDItem(theDialog, 4, &iType, &h, &box); /* get the icon item's info */
-
- UseResFile (myResRefNum);
- if (useColor)
- {
- cH = GetCIcon (128);
- PlotCIcon (&box, cH);
- }
- else
- {
- h = GetResource ('ICN#', 128);
- PlotIcon (&box, h);
- }
-
- SetPort(oldPort); /* restore the current grafport */
-
- return;
- }
-